import { network } from '@/utils';
import { TableListParams, saveInfoParams, updateInfoParams } from './data';

import { basic } from '../../../../../../config/Apis';

export async function queryPartitionList(params: TableListParams) {
  return network.get(basic.shelf_cell_list, {
    params,
  });
}

export async function operSaveOrUpdate(params: updateInfoParams & saveInfoParams) {
  return params.id ? network.put(basic.shelf_cell, { data: params })
    : network.post(basic.shelf_cell, { data: params });
}

export async function operDeletePartition(params: { id: number }) {
  return network.deleter(basic.shelf_cell, { params });
}
